<?php

namespace App\Http\Requests\Api;

use App\Http\Requests\Request;

class SendCaptcha extends Request
{
    public function rules()
    {
        return [
            'mobile' => [
                'required',
                'regex:/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/',
            ],
        ];
    }

    public function messages()
    {
        return [
            'mobile.required' => '请输入手机号',
            'mobile.regex' => '请输入合法的手机号',
        ];
    }
}
